package com.rico.system.entity.menu;

import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.CreatedDate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author 吴泽胜
 * @FileName SysMenu
 * @date 2021-04-25 5:40 上午
 * @Software: IntelliJ IDEA
 */

@Getter
@Setter
@Entity
@Table(name = "system_menu")
public class SysMenu implements Serializable {
    // 复合主键要用这个注解
    @EmbeddedId
    @Id
    private MenuKey key;

    @Column(name = "id")
    private Long id;

    @Column(name = "pid")
    private Long pid;

    @Column(name = "title")
    private String title;

    @Column(name = "icon")
    private String icon;

    @Column(name = "href")
    private String href;

    @Column(name = "target")
    private String target;

    @Column(name = "sort")
    private Long sort;

    @Column(name = "status")
    private Boolean status;

    @Column(name = "remark")
    private String remark;

    @CreatedDate
    @Column(name = "create_at")
    private Date create_at;

    @CreatedDate
    @Column(name = "update_at")
    private Date update_at;

    @Column(name = "delete_at")
    private Date delete_at;
}
